<?php get_header() ?>
<?php 
$catslideshow = 2; 
?>
<div class="main">
    <div class="slide-home">
        <div class="container">
            <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
              <!-- Wrapper for slides -->
              <div class="carousel-inner">
                <?php
                    wp_reset_query(); $k = 0 ; 
                    query_posts(array('cat' => $catslideshow));
                    while (have_posts()): the_post();
                        ?>
                        <div class="item <?php echo !$k++ ? 'active' : ''  ?>">
                            <a href="<?php the_permalink() ?>">
                                <?php the_post_thumbnail(array(980, 432), array('class' => 'img-thumbnail')) ?>
                            </a>
                            <div class="subdesc">
                                <h2><?php the_title() ?></h2>
                                <?php the_excerpt() ?>
                                <p class="viewmore"><a href="<?php the_permalink() ?>">Xem thêm</a></p>
                            </div>  
                        </div>
                    <?php endwhile; ?>
              </div>

              <!-- Controls -->
              <a class="left carousel-control" href="#carousel-example-generic" data-slide="prev">
                <span class="glyphicon slide-left"></span>
              </a>
              <a class="right carousel-control" href="#carousel-example-generic" data-slide="next">
                <span class="glyphicon slide-right"></span>
              </a>
            </div>
        </div>
    </div>
    <div class="content-service">
        <div class="container">
            <div class="left service">
                <div class="breadcrumbs">
                 <?php wp_reset_query(); if(function_exists('bcn_display')){bcn_display();}?>
                </div>
                <div class="content">
                    <?php while ( have_posts() ) : the_post(); ?>
                    <h2><?php the_title() ?></h2>
                    <div class="stab">
                        <div class="mtab"></div>
                        <div class="mcon">
                            <div style="display:block;">
                               <?php the_content() ?>
                            </div>
                        </div>
                    <?php endwhile; // end of the loop. ?>
                        <div class="relate">
                            <p>Dịch vụ liên quan</p>
                            <ul>
                                <?php
                                $currCat = get_the_category($post->ID);
                                $currPost = $post->ID;
                                foreach($currCat as $key=>$value){
                                    if($value->slug==get_cat_slug($catslideshow)) unset($currCat[$key]);
                                }
                                $currCat = array_values($currCat);
                                wp_reset_query();
                                query_posts(array('order'=>'ASC','category__in' => array($currCat[0]->cat_ID)));
                                while (have_posts()): the_post(); ?>
                                <?php if($currPost==get_the_ID()) continue; ?>
                                <li ><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></li>
                                <?php endwhile; ?>
                            </ul>
                        </div>
                        <div class="share">
                            <iframe src="//www.facebook.com/plugins/like.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FTh%25E1%25BA%25A9m-M%25E1%25BB%25B9-Vi%25E1%25BB%2587n-Vi%25E1%25BB%2587t-H%25C3%25A0n%2F133661310148608&amp;width=690&amp;layout=standard&amp;action=like&amp;show_faces=true&amp;share=true&amp;height=30&amp;appId=374852905983810" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:690px; height:30px;" allowTransparency="true"></iframe>
                            <div id="fb-root"></div>
                            <script>(function(d, s, id) {
                              var js, fjs = d.getElementsByTagName(s)[0];
                              if (d.getElementById(id)) return;
                              js = d.createElement(s); js.id = id;
                              js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=370672979703477";
                              fjs.parentNode.insertBefore(js, fjs);
                            }(document, 'script', 'facebook-jssdk'));</script>
                            <div class="fb-comments" data-href="<?php echo site_url() ?>/<?php echo $post->post_name ?>" data-numposts="5" data-width="650" data-colorscheme="light"></div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="right">
                <?php get_sidebar() ?>
            </div>
        </div>
    </div>
</div>

<?php get_footer() ?>

